home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: bath.ac.uk!uwe-bristol!pa-ross
- From: pa-ross@pat.uwe.ac.uk (P Ross)
- Subject: Linking MikMod 2.03 to Watcom c++ code
- Message-ID: <1996Feb27.131614.12598@pat.uwe.ac.uk>
- Sender: usenet@pat.uwe.ac.uk (uwe nntp usenet poster)
- Nntp-Posting-Host: usenet@pat.uwe.ac.uk (uwe nntp usenet poster)
- Organization: University of the West of England, Bristol
- Date: Tue, 27 Feb 1996 13:16:14 GMT
-
- For all linking gurus and wizards here are a couple of questions that have
- stopped me dead in my tracks and I can't go on until I find the answers :(
-
- o Linking MikMod 2.03 to watcom c++
- -----------------------------------
- I can create all the libraries, compile the code no problems. However I want
- to use this library from within my own c++ code. When I try and call
- the function it says function <whatever> is an undefined reference. I've
- compiled the code using wcc386. I've checked that all the header files
- contain extern "C" {} before and after the function prototypes, so what gives?
- Has anyone managed this before ?
- I've tried _everything_ I can think of. Using extern "C", putting underscores
- on the function names, converting the code to compile with wpp386 (which just
- crashes when I run it), putting all the object files into one library, etc
- etc. _Please_ help !!!!!!!!!!!!!!!!!!!!!!!!!!!
-
- o Duplicate decleration of <var_name> ignored
- ---------------------------------------------
- Ok, so I've got two modules that both need to know the value of a particular
- global variable (i'm doing alot of low level interrupt stuff as well). So I
- define the global variable as
-
- extern "C" {uint clock_ticks;};
-
- In the header file and include it with all the external function prototypes
- into my .cpp code. Everything compiles and links ok but I then get this
- "Redecleration of _clock_ticks ignored in module timer.cpp" The code still
- works, and everything is ok, but I wish that I didn't have this error :(
-
- Thanks,
-
- Paul
-
-
-
-